package cn.com.test.common.bean;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.DisposableBean;

import java.util.Date;

public class Email implements DisposableBean, BeanNameAware {

	private String name;
	private String address;
	private Date registerDate;

	/**
	 * 获取name
	 *
	 * @return name
	 */
	public String getName() {
		return name;
	}

	/**
	 * 设置name
	 *
	 * @param name name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * 获取address
	 *
	 * @return address
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * 设置address
	 *
	 * @param address address
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * 获取registerDate
	 *
	 * @return registerDate
	 */
	public Date getRegisterDate() {
		return registerDate;
	}

	/**
	 * 设置registerDate
	 *
	 * @param registerDate registerDate
	 */
	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}

	@Override
	public void destroy() throws Exception {
		System.out.println("emailBean 销毁");
	}

	@Override
	public void setBeanName(String name) {
		System.out.println("beanName为" + name);
	}

	@Override
	public String toString() {
		return ReflectionToStringBuilder.toString(this);
	}
}
